<?
function query($query,$extra="")
{
	$result = mysql_query($query) or die("Query execution error : <br> Query : $query <br> Query Type : $extra");
	return $result;
}

function showStaffSelect($staffid="")
{	
	if (!is_numeric($staffid))
		$staffid = "";	
	
	$business_id = "2";

	$query = "select * from staff where business_id='$business_id' and status=1";
	$results = query($query,"staff memeber selection");

	?>
	<select name="selectstaff" onChange="location.href='<? echo $_SERVER['PHP_SELF'] ?>?staffid='+this.value">
	<option value="0">No Preference</option>
	<?
		while( $row = mysql_fetch_object($results))
		{
			if($staffid == $row->staff_id) 
				$select="selected";
			else 
				$select="";
			echo "<option value='".$row->staff_id."' $select>$row->first_name</option>\n";
		}
	?>
	</select>
	<?

}
?>